import os

import unittest
from zope.testing import doctest
from zope.testing import doctestunit
from zope.component import testing
from Testing import ZopeTestCase
import Products.Five
from Products.Five import zcml
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase
from Products.PloneTestCase.layer import PloneSite
from Products.PloneTestCase.layer import onsetup

import ely.seleniumrctestlayer.seleniumrctestlayer


fiveconfigure.debug_mode = True
zcml.load_config('configure.zcml', Products.Five)
fiveconfigure.debug_mode = False

PloneTestCase.setupPloneSite()


class TestCase(PloneTestCase.FunctionalTestCase):

    pass

optionflags = (doctest.ELLIPSIS |
               doctest.NORMALIZE_WHITESPACE)

def test_suite():
    return unittest.TestSuite([
        ZopeTestCase.ZopeDocFileSuite(
            'google.txt',
            package='ely.seleniumrctestlayer.tests',
            test_class=TestCase,
            optionflags=optionflags,
            ),
        ZopeTestCase.FunctionalDocFileSuite(
            'plone.txt',
            package='ely.seleniumrctestlayer.tests',
            test_class=TestCase,
            optionflags=optionflags,
            ),
        ])
